import { GSprite } from "../../../../../com/mui/controls/GSprite";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../../resource/ImagesConst";
import { BaseItem } from "../../common/BaseItem";
import { ItemData } from "../../../resource/info/ItemData";
import { FlyToNavbarTool } from "../../award/FlyToNavbarTool";
//class SpecialRewardGoodItem
    
    export  class SpecialRewardGoodItem extends GSprite
    {
        constructor()
        {
            super();
            this.initUI();
            return;
        }

        protected initUI(): void
        {
            this._bg = GlobalClass.getBitmap(ImagesConst.PackItemBg);
            addChild(this._bg);
            this._item = new BaseItem();
            this._item.setSize(32, 32);
            this._item.x = 3;
            this._item.y = 3;
            addChild(this._item);
            return;
        }

        public updateData(arg1: ItemData): void
        {
            this._item.source = arg1.itemInfo.url;
            this._item.amount = arg1.itemAmount;
            this._item.toolTipData = arg1.getToolTipData();
            return;
        }

        public flyToPack(): void
        {
            if (this._item && this._item.bitmapdata) 
            {
                FlyToNavbarTool.flyToBackPack(this._item.bitmapdata, localToGlobal(new Object /* flash.geom.Point */(this._item.x, this._item.y)));
            }
            return;
        }

        public /* override */ dispose(arg1: Boolean=true): void
        {
            this._item.source = null;
            this._item.amount = 0;
            this._item.toolTipData = null;
            return;
        }

        public /* override */ get width(): number
        {
            return this._bg.width;
        }

        public /* override */ get height(): number
        {
            return this._bg.height;
        }

        /* internal */ /* var */_bg: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_item: BaseItem;
    }
